﻿<!DOCTYPE html>
<html>
<!-- MSDS数据库-编辑 -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script src="/static/js/wangEditor.min.js" type="text/javascript"></script>
    <link href="/static/js/wangEditor.min.css" rel="stylesheet" />
    <style>

        .popupW100 .inputTextarea .el-form-item__content {
            margin-left: 0px !important;
        }

        body {
            padding-bottom: 10px;
        }
        .yangshi1 {
            font-weight: bold
        }
    </style>
</head>

<body>
    <div id="app" class="popupW100" v-cloak>
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                 size="mini">

            <el-row style="margin-bottom:8px">
                <el-col :span="24" style=" text-align:center" class="yangshi1">
                    HSE管理目标
                </el-col>
            </el-row>
                <div id="editor" style="margin-bottom:10px;"></div>

                <el-row type="flex" justify="end">
                    <el-form-item>
                        <!--   <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>-->
                        <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                        <!--<el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>-->
                    </el-form-item>
   
                </el-row>
        </el-form>
    </div>
    <script type="text/javascript">
        var E = window.wangEditor
        var app = new Vue({
            el: '#app',
            data: {
                Editor: "",
                // picked : '1',
                //父业传参
                id: '132456',
                ListItem: ListItem,
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    Enterpriseid:'',
                    ManagementgoalComent:'',

                },
                //表单验证
                rules: {
                    CouManagementgoalComentntry: [
                        verification.NotNull,
                    ],
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //PDF上传成功
                pdfok: function () {
                    this.$message({
                        message: 'PDF上传成功',
                        type: 'success'
                    });
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    mythis.Form.ManagementgoalComent = mythis.Editor.txt.html();
                    mythis.Form.id = mythis.id;
                        this.$refs[formName].validate(function (valid) {
                            if (valid) {
                            // 不需要关闭窗体
                            onSubmitFormA(this, '/api/HSEManagementgoalEdit/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getDataAdd(this, '/api/HSEManagementgoalEdit/get?id=' + this.id);

                },
            },
            mounted: function () {
                this.getData();
                this.Editor = new E('#editor');
                this.Editor.customConfig.menus = [
                    'head',  // 标题
                    'bold',  // 粗体
                    'fontSize',  // 字号
                    'fontName',  // 字体
                    'italic',  // 斜体
                    'underline',  // 下划线
                    'strikeThrough',  // 删除线
                    'foreColor',  // 文字颜色
                    'backColor',  // 背景颜色
                    'list',  // 列表
                    'justify',  // 对齐方式
                    'table',  // 表格
                    'undo',  // 撤销
                    'redo'  // 重复
                ];
                this.Editor.create();
                this.Editor.txt.html(this.Form.ManagementgoalComent);
                tablehigh(this);

            },

        });
    </script>
</body>

</html>